// =============================================================================
// SCSS/SITE/STACKS/INTEGRITY/_GRAVITY-FORMS.SCSS
// -----------------------------------------------------------------------------
// Additional styling for Gravity Forms.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Base Styles
//   02. Headings and Labels
//   03. Inputs and Containers
//   04. Alerts
// =============================================================================

// Base Styles
// =============================================================================

//
// Form wrapper.
//

body .gform_wrapper {
  max-width: 100%;
  margin: 0 0 $baseMargin;
}


//
// Form heading.
//

body .gform_wrapper .gform_heading {
  width: 100%;
}


//
// Field wrapper.
//

body .gform_wrapper .top_label .gfield,
body .gform_wrapper .top_label li.gsection.gf_scroll_text {
  margin-bottom: 1em !important;
}

body .gform_wrapper .left_label .gfield,
body .gform_wrapper .left_label li.gsection.gf_scroll_text,
body .gform_wrapper .right_label .gfield,
body .gform_wrapper .right_label li.gsection.gf_scroll_text {
  margin-bottom: 1.5em !important;
}


//
// Section title.
//

body .gform_wrapper .top_label .gsection,
body .gform_wrapper .top_label li.gfield.gf_left_half + li.gsection,
body .gform_wrapper .top_label li.gfield.gf_right_half + li.gsection {
  margin-top: 0 !important;
  margin-bottom: 4px !important;
  border-bottom: 1px solid $shortcodeBorderColor;
  border-bottom: 1px solid $shortcodeBorderColorRgba;
  padding: 28px 0 4px;
}

body .gform_wrapper .left_label .gsection,
body .gform_wrapper .left_label li.gfield.gf_left_half + li.gsection,
body .gform_wrapper .left_label li.gfield.gf_right_half + li.gsection,
body .gform_wrapper .right_label .gsection,
body .gform_wrapper .right_label li.gfield.gf_left_half + li.gsection,
body .gform_wrapper .right_label li.gfield.gf_right_half + li.gsection {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  border-bottom: 1px solid $shortcodeBorderColor;
  border-bottom: 1px solid $shortcodeBorderColorRgba;
  padding: 28px 0 6px;
}


//
// Form footer.
//

body .gform_wrapper .gform_footer {
  margin: $baseMargin 0 0;
  padding: 0;
}

body .gform_wrapper .gform_footer.left_label {
  padding: 0 0 0 30%;
  @include break(middle-bear) {
    padding: 0;
  }
}

body .gform_wrapper .gform_footer.right_label {
  padding: 0 30% 0 0;
  @include break(middle-bear) {
    padding: 0;
  }
}



// Headings and Labels
// =============================================================================

//
// Main headings.
//

body .gform_wrapper h3.gform_title,
body .gform_wrapper h2.gsection_title,
body .gform_wrapper .gsection_description {
  width: 100%;
}

body .gform_wrapper h3.gform_title {
  margin: 0 0 0.2em;
  font-size: 200%;
  @include break(baby-bear) {
    font-size: 175%;
  }
}

body .gform_wrapper h2.gsection_title {
  font-size: 125%;
}


//
// Input labels.
//

body .gform_wrapper .top_label .gfield_label {
  margin: 0;
}

body .gform_wrapper .left_label .gfield_label,
body .gform_wrapper .right_label .gfield_label {
  width: 30%;
  padding: 0 4% 0 0;
  font-size: 82.5%;
  @include break(middle-bear) {
    margin-bottom: 0;
  }
}

body .gform_wrapper .left_label .gfield_label {
  float: left;
  margin-right: 0;
  padding: 0 4% 0 0;
  @include break(middle-bear) {
    float: none;
    width: 100%;
    padding: 0;
  }
}

body .gform_wrapper .right_label .gfield_label {
  float: right;
  margin-left: 0;
  padding: 0 0 0 4%;
  text-align: right;
  @include break(middle-bear) {
    float: none;
    width: 100%;
    padding: 0;
    text-align: left;
  }
}

body .gform_wrapper li.gfield.gf_list_2col label.gfield_label,
body .gform_wrapper li.gfield.gf_list_3col label.gfield_label,
body .gform_wrapper li.gfield.gf_list_4col label.gfield_label,
body .gform_wrapper li.gfield.gf_list_5col label.gfield_label,
body .gform_wrapper li.gfield.gf_list_inline label.gfield_label {
  margin-top: 0;
}


//
// Description text.
//

body .gform_wrapper .ginput_complex label,
body .gform_wrapper .description,
body .gform_wrapper .gfield_description,
body .gform_wrapper .gsection_description,
body .gform_wrapper .instruction {
  font-family: inherit;
  font-size: 67.5%;
  @include opacity(0.7);
}

body .gform_wrapper .description,
body .gform_wrapper .gsection_description {
  padding: 5px 0 0;
}

body .gform_wrapper .gfield_description {
  padding: 2px 0 0;
}

body .gform_wrapper .description_above .gfield_description {
  padding: 0 0 2px;
}

body .gform_wrapper .left_label .instruction,
body .gform_wrapper .left_label .gfield_description,
body .gform_wrapper .left_label li.gsection.gf_scroll_text {
  width: 70% !important;
  margin-left: 30% !important;
  margin-right: 0 !important;
  @include break(middle-bear) {
    width: 100% !important;
    margin-left: 0 !important;
  }
}

body .gform_wrapper .right_label .instruction,
body .gform_wrapper .right_label .gfield_description,
body .gform_wrapper .right_label li.gsection.gf_scroll_text {
  width: 70% !important;
  margin-left: 0 !important;
  margin-right: 30% !important;
  @include break(middle-bear) {
    width: 100% !important;
    margin-right: 0 !important;
  }
}

body .gform_wrapper .ginput_complex label,
body .gform_wrapper .gfield_time_hour label,
body .gform_wrapper .gfield_time_minute label,
body .gform_wrapper .gfield_date_month label,
body .gform_wrapper .gfield_date_day label,
body .gform_wrapper .gfield_date_year label,
body .gform_wrapper .instruction {
  margin: 0;
}


//
// Checkbox and radio labels.
//

body .gform_wrapper .gfield_radio li label,
body .gform_wrapper .gfield_checkbox li label {
  @include font-size(1.3);
}


//
// Focus states.
//

body .gform_wrapper .ginput_full input:focus + label,
body .gform_wrapper .ginput_left input:focus + label,
body .gform_wrapper .ginput_right input:focus + label {
  font-weight: inherit
}

body .gform_wrapper ul.gfield_radio li input[type="radio"]:checked + label,
body .gform_wrapper ul.gfield_checkbox li input[type="checkbox"]:checked + label {
  font-weight: inherit;
}


//
// Browser adjustments.
//

body .gform_wrapper.gf_browser_chrome .gfield_checkbox li label,
body .gform_wrapper.gf_browser_chrome .gfield_radio li label,
body .gform_wrapper.gf_browser_safari .gfield_checkbox li label,
body .gform_wrapper.gf_browser_safari .gfield_radio li label {
  margin-top: 2px;
}



// Inputs and Containers
// =============================================================================

//
// Base style.
//

body .gform_wrapper input[type=text],
body .gform_wrapper input[type=url],
body .gform_wrapper input[type=email],
body .gform_wrapper input[type=tel],
body .gform_wrapper input[type=number],
body .gform_wrapper input[type=password],
body .gform_wrapper select,
body .gform_wrapper textarea {
  display: inline-block;
  height: 2.65em;
  margin: 3px 0;
  padding: 0 0.65em;
  line-height: 2.65em;
  @include font-size(1.3);
}

body .gform_wrapper select[multiple],
body .gform_wrapper select[size] {
  height: auto;
}


//
// Browser adjustments.
//

body .gform_wrapper.gf_browser_gecko select {
  padding: 0.45em 0.65em;
}


//
// All containers.
//

body .gform_wrapper .top_label li.gfield.gf_left_half,
body .gform_wrapper .top_label li.gfield.gf_left_third,
body .gform_wrapper .top_label li.gfield.gf_middle_third {
  margin-right: 4%;
}

body .gform_wrapper .top_label li.gfield.gf_left_half,
body .gform_wrapper .top_label li.gfield.gf_right_half,
body .gform_wrapper .top_label li.gfield.gf_left_third,
body .gform_wrapper .top_label li.gfield.gf_middle_third,
body .gform_wrapper .top_label li.gfield.gf_right_third {
  float: left;
  margin-left: 0 !important;
}

body .gform_wrapper li.gfield .ginput_complex .ginput_full,
body .gform_wrapper li.gfield .ginput_complex .ginput_left,
body .gform_wrapper li.gfield .ginput_complex .ginput_right {
  margin-bottom: 8px;
}

body .gform_wrapper li.gfield .ginput_complex .ginput_full + .ginput_left,
body .gform_wrapper li.gfield .ginput_complex .ginput_left + .ginput_left,
body .gform_wrapper li.gfield .ginput_complex .ginput_right + .ginput_left {
  clear: left;
}

body .gform_wrapper li.gfield .ginput_complex .ginput_full + .ginput_right,
body .gform_wrapper li.gfield .ginput_complex .ginput_left + .ginput_right,
body .gform_wrapper li.gfield .ginput_complex .ginput_right + .ginput_right {
  clear: right;
}


//
// Half size containers.
//

body .gform_wrapper .top_label input.medium,
body .gform_wrapper .top_label select.medium,
body .gform_wrapper .top_label li.gfield.gf_left_half,
body .gform_wrapper .top_label li.gfield.gf_right_half {
  width: 48%;
  @include break(baby-bear) {
    float: none;
    width: 100%;
  }
}

body .gform_wrapper .ginput_complex .ginput_left,
body .gform_wrapper .ginput_complex .ginput_right,
body .gform_wrapper .gfield_error .ginput_complex .ginput_left,
body .gform_wrapper .gfield_error .ginput_complex .ginput_right {
  width: 48%;
  @include break(middle-bear) {
    float: none;
    width: 100%;
  }
}


//
// Third size containers.
//

body .gform_wrapper .top_label li.gfield.gf_left_third,
body .gform_wrapper .top_label li.gfield.gf_middle_third,
body .gform_wrapper .top_label li.gfield.gf_right_third {
  width: 30.66667%;
  @include break(baby-bear) {
    float: none;
    width: 100%;
  }
}


//
// Radio and checkboxs.
//

body .gform_wrapper .gfield_radio li,
body .gform_wrapper .gfield_checkbox li {
  margin-bottom: 0 !important;
}

body .gform_wrapper .gfield_radio li input,
body .gform_wrapper .gfield_checkbox li input {
  margin-left: 1px;
}


//
// List columns.
//

body .gform_wrapper li.gfield.gf_list_2col ul.gfield_checkbox li,
body .gform_wrapper li.gfield.gf_list_2col ul.gfield_radio li {
  padding-left: 2.5% !important;
  @include break(baby-bear) {
    float: none;
    width: 100%;
    padding-left: 0 !important;
  }
}

body .gform_wrapper li.gfield.gf_list_3col ul.gfield_checkbox li,
body .gform_wrapper li.gfield.gf_list_3col ul.gfield_radio li {
  padding-left: 2.5% !important;
  @include break(middle-bear) {
    float: none;
    width: 100%;
    padding-left: 0 !important;
  }
}

body .gform_wrapper li.gfield.gf_list_2col ul.gfield_checkbox li:nth-child(2n+1),
body .gform_wrapper li.gfield.gf_list_2col ul.gfield_radio li:nth-child(2n+1),
body .gform_wrapper li.gfield.gf_list_3col ul.gfield_checkbox li:nth-child(3n+1),
body .gform_wrapper li.gfield.gf_list_3col ul.gfield_radio li:nth-child(3n+1) {
  padding-left: 0 !important;
}


//
// Small inputs.
//

body .gform_wrapper .top_label input.small,
body .gform_wrapper .top_label select.small,
body .gform_wrapper .left_label input.small,
body .gform_wrapper .left_label select.small,
body .gform_wrapper .right_label input.small,
body .gform_wrapper .right_label select.small {
  width: 25%;
  @include break(baby-bear) {
    width: 100%;
  }
}


//
// Left and right label configurations.
//

body .gform_wrapper .left_label input.medium,
body .gform_wrapper .left_label select.medium,
body .gform_wrapper .right_label input.medium,
body .gform_wrapper .right_label select.medium {
  width: 33.635%;
  @include break(middle-bear) {
    width: 100%;
  }
}

body .gform_wrapper .left_label div.ginput_complex,
body .gform_wrapper .right_label div.ginput_complex,
body .gform_wrapper .left_label textarea.textarea,
body .gform_wrapper .right_label textarea.textarea,
body .gform_wrapper .left_label input.large,
body .gform_wrapper .left_label select.large,
body .gform_wrapper .right_label input.large,
body .gform_wrapper .right_label select.large {
  width: 70%;
  @include break(middle-bear) {
  	width: 100%;
  }
}

body .gform_wrapper .left_label li.gfield.gf_left_half,
body .gform_wrapper .right_label li.gfield.gf_left_half,
body .gform_wrapper .left_label li.gfield.gf_right_half,
body .gform_wrapper .right_label li.gfield.gf_right_half {
  @include break(middle-bear) {
    clear: none;
    width: 48%;
  }
  @include break(baby-bear) {
    clear: both;
    width: 100%;
  }
}

body .gform_wrapper .left_label li.gfield.gf_left_half,
body .gform_wrapper .right_label li.gfield.gf_left_half {
  @include break(middle-bear) {
    clear: left;
    float: left;
  }
}

body .gform_wrapper .left_label li.gfield.gf_right_half,
body .gform_wrapper .right_label li.gfield.gf_right_half {
  @include break(middle-bear) {
    clear: right;
    float: right;
  }
}


//
// Scroll text.
//

body .gform_wrapper li.gsection.gf_scroll_text {
  overflow-x: hidden;
  overflow-y: scroll;
  border: 1px solid $inputBorder !important;
  padding-right: 20px;
  border-radius: 4px;
}


//
// Base input sizing.
//

body .gform_wrapper .top_label input.large,
body .gform_wrapper .top_label select.large,
body .gform_wrapper .top_label textarea.textarea,
body .gform_wrapper .top_label li.gfield.gf_left_half input.medium,
body .gform_wrapper .top_label li.gfield.gf_left_half input.large,
body .gform_wrapper .top_label li.gfield.gf_left_half select.medium,
body .gform_wrapper .top_label li.gfield.gf_left_half select.large,
body .gform_wrapper .top_label li.gfield.gf_right_half input.medium,
body .gform_wrapper .top_label li.gfield.gf_right_half input.large,
body .gform_wrapper .top_label li.gfield.gf_right_half select.medium,
body .gform_wrapper .top_label li.gfield.gf_right_half select.large,
body .gform_wrapper .top_label li.gfield.gf_left_third input.medium,
body .gform_wrapper .top_label li.gfield.gf_left_third input.large,
body .gform_wrapper .top_label li.gfield.gf_left_third select.medium,
body .gform_wrapper .top_label li.gfield.gf_left_third select.large,
body .gform_wrapper .top_label li.gfield.gf_middle_third input.medium,
body .gform_wrapper .top_label li.gfield.gf_middle_third input.large,
body .gform_wrapper .top_label li.gfield.gf_middle_third select.medium,
body .gform_wrapper .top_label li.gfield.gf_middle_third select.large,
body .gform_wrapper .top_label li.gfield.gf_right_third input.medium,
body .gform_wrapper .top_label li.gfield.gf_right_third input.large,
body .gform_wrapper .top_label li.gfield.gf_right_third select.medium,
body .gform_wrapper .top_label li.gfield.gf_right_third select.large,
body .gform_wrapper .top_label li.gsection.gf_scroll_text,
body .gform_wrapper .ginput_complex .ginput_left input[type=text],
body .gform_wrapper .ginput_complex .ginput_left input[type=url],
body .gform_wrapper .ginput_complex .ginput_left input[type=email],
body .gform_wrapper .ginput_complex .ginput_left input[type=tel],
body .gform_wrapper .ginput_complex .ginput_left input[type=number],
body .gform_wrapper .ginput_complex .ginput_left input[type=password],
body .gform_wrapper .ginput_complex .ginput_left select,
body .gform_wrapper .ginput_complex .ginput_right input[type=text],
body .gform_wrapper .ginput_complex .ginput_right input[type=url],
body .gform_wrapper .ginput_complex .ginput_right input[type=email],
body .gform_wrapper .ginput_complex .ginput_right input[type=tel],
body .gform_wrapper .ginput_complex .ginput_right input[type=number],
body .gform_wrapper .ginput_complex .ginput_right input[type=password],
body .gform_wrapper .ginput_complex .ginput_right select,
body .gform_wrapper .ginput_complex .ginput_full input[type=text],
body .gform_wrapper .ginput_complex .ginput_full input[type=url],
body .gform_wrapper .ginput_complex .ginput_full input[type=email],
body .gform_wrapper .ginput_complex .ginput_full input[type=tel],
body .gform_wrapper .ginput_complex .ginput_full input[type=number],
body .gform_wrapper .ginput_complex .ginput_full input[type=password],
body .gform_wrapper .ginput_complex .ginput_full select,
body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=text],
body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=url],
body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=email],
body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=tel],
body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=number],
body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=password],
body .gform_wrapper .gfield_error .ginput_complex .ginput_left select,
body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=text],
body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=url],
body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=email],
body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=tel],
body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=number],
body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=password],
body .gform_wrapper .gfield_error .ginput_complex .ginput_right select {
  width: 100% !important;
}



// Alerts
// =============================================================================

body .gform_wrapper .top_label .gfield_error,
body .gform_wrapper .top_label .gfield_error .ginput_container {
  width: 100%;
  max-width: 100%;
}

body .gform_wrapper li.gfield.gfield_error.gfield_contains_required label.gfield_label {
  margin-top: 0;
}

body .gform_wrapper li.gfield.gfield_error,
body .gform_wrapper li.gfield.gfield_error.gfield_contains_required {
  border: 1px solid;
  padding: 6px 10px !important;
  border-color: $errorBorder;
  color: $errorText;
  background-color: $errorBackground;
}

body .gform_wrapper .validation_message {
  font-weight: inherit;
}